<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	List<TblCheckSchedule> list = (List<TblCheckSchedule>)request.getAttribute("list");
	LeaveForm form = (LeaveForm)request.getAttribute("command");
%>
<div class="main">
	<div class="oaTable">
<table class="tableList">

	<thead>
		<tr>
			<td colspan="10" style="width: 100%;">
				<div class="FormTools">
					<div>工号：
						<input id="userid" type="text" name="userid" class="search" value="<%=StringUtils.isNotBlank(form.getUserid())?form.getUserid():""%>"
							placeholder="请输入员工编号"/>
						<input type="button" class="searchSubmit" onclick="javascript:XF.Check.scheduleListSearch()" value="搜索"/>
					</div>
					<div>部门：
						<select id="deptList" class="easyui-combobox" name="deptid" style="width:100px;"></select>
					</div>
					<div>所属公司：
						<select id="siteList" class="easyui-combobox" name="siteid" style="width:100px;"></select>
					</div>
				</div>
			</td>
		</tr>
	</thead>

	<tbody>
		<tr id="tableHeader">
			<th style="width: 5%">编号</th>
			<th style="width: 10%">人员</th>
			<th style="width: 12%">当前班次</th>
			<th style="width: 5%">开始时间</th>
			<th style="width: 5%">结束时间</th>
			<th style="width: 5%">日排班明细</th>
			<th style="width: 5%">添加人</th>
			<th style="width: 10%">添加时间</th>
			<th style="width: 10%">操作</th>
		</tr>
		<%
			int i =1;
			if (list != null && list.size() > 0) {
				for (TblCheckSchedule schedule: list) {
					String id = EncrypTool.encode(schedule.getId()+"");
		%>
						<tr>
							<td><%=i %></td>
							<td><%=schedule.getUsername()!=null?schedule.getUsername():"" %></td>
							<td><%=schedule.getShiftName()%></td>
							<td><%=null!=schedule.getStartdate()?DateFormatUtils.format(schedule.getStartdate().getTime(), "yyyy-MM-dd"):"" %></td>
							<td><%=null!=schedule.getEnddate()?DateFormatUtils.format(schedule.getEnddate().getTime(), "yyyy-MM-dd"):"" %></td>
							<td><a style="color:#ff5a00" href="javascript:XF.Check.userSchedule('<%=schedule.getUserid()%>','<%=schedule.getUsername()%>','<%=schedule.getId()%>')">查看明细</a></td>
							<td><%=schedule.getAdduser()%></td>
							<td><%=null!=schedule.getAddtime()?DateFormatUtils.format(schedule.getAddtime().getTime(), "yyyy-MM-dd HH:mm:ss"):"" %></td>
							<td>
								<div class="innerBtnWrap">
									<a class="a-btn-microsoft btn" href="javascript:XF.Check.editSchedule('<%=id %>')">修改</a>
									<a class="a-btn-microsoft btn topBtn" href="javascript:XF.Check.deleteSchedule('<%=id %>')">删除</a>
								</div>
							</td>
						</tr>
					<%
				    i++;
				}
			}
		
		%>
		        
        <tr id="tableFooter">
			<td colspan="10">
				<div class="pagination">
					<monggoTag:pagination href="schedule_search"
						pageSize="<%=form.getPageSize()%>"
						totalRecord="<%=form.getTotalRecord() %>"
						currentPage="<%=form.getPageNum() %>">
					</monggoTag:pagination>
				</div>
			</td>
		</tr>
	</tbody>
</table>
</div>
</div>
<div id="schedule_popwin" closed="true" class="easyui-window" title="日排名表" style="width:600px;height:480px;"></div>
<script>
$('#siteList').combobox({
	url:global.contextPath + '/company/siteList',
	valueField:'siteid',
	textField:'sitename',
});
$('#deptList').combobox({
	url:global.contextPath + '/company/deptList',
	valueField:'dictid',
	textField:'dictname',
});
$('#siteList').combobox('setValue', '<%=form.getSiteid() %>');
$('#deptList').combobox('setValue', '<%=form.getDeptid() %>');
$("#schedule_popwin").window();
</script>